package com.firmail.enumeration.impl;

import com.firmail.enumeration.MockParamsEnum;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Getter
public enum DataTypeEnum implements MockParamsEnum {

    JSON(1,"JSON"), XML(2,"XML"),HTML(3,"HTML"),SCRIPT(4,"SCRIPT");

    private DataTypeEnum(int value, String name){
        this.value= value;
        this.name=name;
    }

    private int value;

    private String name;

    public static DataTypeEnum getByValue(int value){
        for (DataTypeEnum dataTpe: DataTypeEnum.values()) {
            if (dataTpe.getValue()==value)
                return dataTpe;
        }
        return null;
    }


    @Override
    public void print() {
        log.info("{} :{}", this.value, this.name);
    }

    @Override
    public String getInfo() {
        return this.name;
    }
}
